package com.hippomeetsskunk.savanna.types.goal;

import java.util.Collections;

import com.hippomeetsskunk.savanna.types.person.Person;
import com.hippomeetsskunk.savanna.types.person.Skills;
import com.hippomeetsskunk.savanna.types.resource.SimObject;

public class SellingGoal extends AbstractGoal implements Goal {

	private final SimObject object;
	private double price;
	
	@SuppressWarnings("unchecked")
	public SellingGoal(
			Skills requiredSkills,
			SimObject object,
			Person seller,
			double urgency) {
		super(seller, requiredSkills, Collections.EMPTY_SET, object.getIntrinsicValue(), urgency);
		this.object = object;
		// needs some initial profit factor (high enough, as meeting this price = instant buy)
		this.price = object.getIntrinsicValue() * 1.1;
	}

	public void execute(){
		// have to see how to handle shopping, might be completely rule based
	}
	
	@Override
	public String toString() {
		return "Selling(" + object + ")";
	}

	public SimObject getObject() {
		return object;
	}

	public double getPrice() {
		return price;
	}

	public void setPrice(double price) {
		// rules should modify the price based on demand (lower only)
		this.price = price;
	}	

}
